package Test_2019_2_18;

/**
 * 打印九九乘法表(至少2种形式)
 */
public class Test12 {
    private void table1() {
        for (int i = 1; i <= 9; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print(j + "*" + i + "=" + j * i + "\t");
            }
            System.out.println();
        }
    }

    private void table2() {
        for (int i = 9; i > 0; i--) {
            for (int j = 1; j <= i; j++) {
                System.out.print(j + "*" + i + "=" + i * j + "\t");
            }
            System.out.println();
        }
    }

    public static void main(String[] args) {
        Test12 t = new Test12();
        t.table1();
        System.out.println();
        t.table2();
    }
}
